﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using FamilyBook.Core.Services;
using FamilyBook.UI.WPF.Views;
using Microsoft.Practices.Prism.Commands;

namespace FamilyBook.UI.WPF.ViewModels
{
    public class LoginViewModel// : BaseViewModel
    {
        private readonly UserService _userService;

        public LoginViewModel(LoginPage pageView, UserService userService)
            : base()
        {
            _userService = userService;
            LoginCommand = new DelegateCommand<object>(LoginExecute, CanExecuteLoginCommand);
        }

        private string _userName;
        public string UserName
        {
            get { return _userName; } 
            set
            {
                _userName = value;
                //this.RaisePropertyChanged(() => UserName);
            }
        }
        private string _password;
        public string Password
        {
            get { return _password; }
            set 
            {
                _password = value;
                //RaisePropertyChangedEvent(x => Password);
            }
        }
        public bool RememberMe { get; set; }
        public ICommand LoginCommand { get; private set; }

        public bool CanExecuteLoginCommand(object prm)
        {
            return true;
        }

        public void LoginExecute(object prm)
        {
            //if (_userService.VerifyUser(UserName, Password))
                //_pageView.NavigationService.Navigate(new AccountsPage());

        }
    }
}
